home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6731 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.th-darmstadt.de!news!enno
  2. From: enno@inferenzsysteme.informatik.th-darmstadt.de (Enno Sandner)
  3. Newsgroups: comp.lang.tcl,comp.lang.c,comp.lang.c++,comp.databases.sybase,comp.databases.oracle,comp.databases.informix,comp.databases.oracle
  4. Subject: Re: realloc equivalent in C++
  5. Date: 10 Feb 1996 09:33:05 GMT
  6. Organization: Fachbereich Informatik, TH Darmstadt
  7. Distribution: world
  8. Message-ID: <ENNO.96Feb10103305@kitz.inferenzsysteme.informatik.th-darmstadt.de>
  9. References: <4fecgc$ar9@engr.orst.edu> <DMJ15v.13C@falcon.daytonoh.attgis.com>
  10.     <4fgir1$pri@theory.tc.cornell.edu>
  11. NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
  12. In-reply-to: hzhou@r26n05.tc.cornell.edu's message of 9 Feb 1996 22:45:53 GMT
  13.  
  14. In article <4fgir1$pri@theory.tc.cornell.edu> hzhou@r26n05.tc.cornell.edu (Honbo Zhou) writes:
  15.  
  16.    Is there anything in C++ equvalent to realloc in C which can be used
  17.    to increase allocated memory? Can't find this even in C++ books which
  18.    talk about memory management specifically. Thanks. Honbo 
  19.  
  20. Nothing prevents you from using 'realloc' in C++ to allocate _raw-memory_.
  21. However you shouldn't mix the 'malloc/free/realloc/...' with the 'new/
  22. new[]/delete/delete[]/...' families. The former are intended the maintain
  23. raw-memory while the latter manage the lifetime of objects. C++ has no
  24. direct support to reallocate an array of objects.
  25.  
  26.         Enno
  27. --
  28.     Enno
  29.